package com.dxysun.spring.mvc;

import java.util.Map;

public class DXYModelAndView
{
	private String viewName;
	private Map<String, ?> model;

	public DXYModelAndView(String viewName, Map<String, ?> model)
	{
		this.viewName = viewName;
		this.model = model;
	}

	public DXYModelAndView(String viewName)
	{
		this.viewName = viewName;
	}

	public String getViewName()
	{
		if(viewName.endsWith(".html"))
			return viewName;
		else
			return viewName + ".html";
	}

	public void setViewName(String viewName)
	{
		this.viewName = viewName;
	}

	public Map<String, ?> getModel()
	{
		return model;
	}

	public void setModel(Map<String, ?> model)
	{
		this.model = model;
	}
}
